﻿using JobSearcherAPI.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JobSearcherAPI.Search
{
    internal abstract class SearcherBase : IJobSearcher
    {
        protected string searchAddress = string.Empty;
        protected StringBuilder stringBuilder = new StringBuilder();
        // Attribute strings
        protected string title = "title";
        protected string description = "description";
        protected string company = "company";
        protected string location = "location";
        protected string date = "date";
        protected string url = "url";

        protected abstract void SetUpAttributeStrings();
        protected abstract string CreateSearchAddress(SearchArguments arguments);

        public string API_ID { get; set; }
        public string Key { get; set; }
        public abstract Task<SearchResult> Search(SearchArguments arguments);

        public override string ToString()
        {
            return base.ToString().Replace("Searcher", "");
        }
    }
}
